package com.fhao.aop;

import com.fhao.aop.controller.Iface;
import com.fhao.aop.controller.TestController;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringAopApplication {

	public static void main(String[] args) {
		ApplicationContext context = SpringApplication.run(SpringAopApplication.class, args);

		//CGLib代理类
		TestController bean = context.getBean(TestController.class);
		System.out.println(bean);

		//JDK代理接口
		Iface iface = (Iface)context.getBean("testController2");
		System.out.println(iface);
	}

}

























